<template>
    <div id="box">
        <div id="search">
            <span @click="back" slot="left" class="fa fa-chevron-left nav-size"></span>
            <input type="text" class="nav-size">
            <img src="static/icons/search.png" class="img-size">
        </div>
        <div id="search-box">
            <!--目的地-->
            <div id="country-box" >
                <div class="left">
                    <p>{{country[0].type}}</p>
                    <p>{{startCity[0].startCity}}</p>
                </div>
                <div id="right-content">   
                    <div class="right" v-for="i in country[0].countries">    
                        <div>
                            <input type="checkbox">
                            <p class="country-title">{{i.region}}</p>
                        </div>
                        <div class="allcity">
                            <div class="right-box" v-for="j in i.cicties">
                                <input type="checkbox">
                                <label for="">{{j}}</label>
                            </div>
                        </div>  
                    </div>
                </div>
            </div>
            <!--出发城市-->
            <!--<div id="start">
                <div class="allcity">
                    <div class="right-box" v-for="a in startCity[0].countries">
                        <input type="checkbox">
                        <label for="">{{a}}</label>
                    </div>
                </div>
            </div>-->
        </div>
    </div>
</template>

<script>
import Navbar from '../components/Navbar.vue';
import {mapState} from "vuex";
export default {
    components:{
        Navbar
    },
    methods:{
        back(){
            history.back();
        }
    },
    computed:{
        ...mapState([
            "country","startCity"
        ])
    },
    mounted:function(){
        this.$store.dispatch("requestStartCity");
        this.$store.dispatch("requestCountry");
    }

}
</script>

<style lang='css' scoped>
    #box{
        position: relative;
    }
    #search-box{
        height: calc(100vh - 53px);
        /*margin-top: 53px;*/
        overflow: hidden;
    }
    .img-size{
        width: 30px;
        height: 30px;
        /*border: 1px solid  red;*/
    }
    #search>input{
        width: 77vw;
        height: 35px;
        border: 1px  solid #e6e6e8;
        border-radius: 5px;
    }
    #search{
        background-color: #f8f8f8;
        /*border: 1px solid  red;*/
        display: flex;
        justify-content: space-between;
        height: 53px;
        width: 100vw;
        line-height: 53px;
        padding:0 10px;
        padding-top: 8px;
        /*position: fixed;
        left: 0;
        top: 0;*/
    }
    .nav-size{
        line-height:40px;
        font-size: 18px;
        color: #0894EC;
    }
    #country-box{
        display: flex;
        color: #777;
    }
    .left{
        width: 30vw;
        background-color: #fcfbfb;
        padding-top: 53px;
        height: 100vh;
        font-size: 14px;
    }
    .left p:nth-of-type(1){
        border: 1px solid red;
        margin-top: 30px;

    }
    #right-content{
        height: calc(100vh - 53px);
        overflow: scroll;
        /*border: 1px solid red;*/
        padding-top: 53px;
    }
    .right{
       background-color: #fff;
       
    }
    .allcity{
        /*border: 1px solid red;*/
        display: flex;
        flex-wrap: wrap;
        /*justify-content: space-around;*/
    }
    .right-box{
        width: 95px;
        height: 40px;
        line-height: 40px;
        font-size: 13px;
        /*border: 1px solid red;*/
        margin-right: 20px;
    }
    .country-title{
        font-size: 15px;
        margin: 0;
        display: inline-block;
        height: 30px;
        color: #036ab5;
        /*border: 1px solid red;*/
        line-height: 30px;
    }
    #start{
        display: flex;
    }


</style>